import { App, Component } from "vue";

export const withInstall = <T extends Component>(component: T) => {
  (component as any).install = (app: App) => {
    app.component((component as any).name || component.name, component);
  };
  return component as T & { install: (app: App) => void };
};
